package level4Assessment;

public class ParkingTransactionFactory 
{
	public ParkingTicket createTicket(char choice,String registrationNumber, int arrivalHour, int arrivalMinute, int hoursStaying)
	{
		if(Character.toLowerCase(choice) == 'd')
		{
			ParkingTicket newParkingTicket = new ParkingTicket(registrationNumber, arrivalHour, arrivalMinute, hoursStaying);
			return newParkingTicket;
		}else
		{
			return null;
		}
		
	}
	
	public ParkingTicket createTicket(char choice, String registrationNumber, int arrivalHour, int arrivalMinute, int expiryHour, int expiryMinute)
	{
		if(Character.toLowerCase(choice) == 'p')
		{
			ParkingTicket newParkingTicket = new ParkingTicket(registrationNumber, arrivalHour, arrivalMinute, expiryHour, expiryMinute);
			return newParkingTicket;
		}else
		{
			return null;
		}
		
	}
}
